<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
</head>
<body>
<form action="" method="post">
    <table class="table table-bordered">
        <tr><td colspan="7">日期范围选择 <input type="date" name="starttime"> 至 <input type="date" name="endtime"> 关键字 <input type="text" name="tname"> <button>查询</button></td></tr>
        <tr align="center">
            <td>编号</td>
            <td>门票名称</td>
            <td>开赛日期</td>
            <td>门票总数</td>
            <td>余票数量</td>
            <td>票价</td>
            <td>门票状态</td>
        </tr>
        {% for ti in ticketslist %}
            <tr align="center">
                <td>{{ ti.id }}</td>
                <td>{{ ti.tname }}</td>
                <td>{{ ti.begintime|date:'Y-m-d'}}</td>
                <td>{{ ti.tickets_num }}</td>
                <td>{{ ti.ticket_remain_num }}</td>
                <td>{{ ti.price }}</td>
                <td>
                    {% if ti.state == "1" %}
                        在售
                    {% endif %}
                    {% if ti.state == "0" %}
                        停售
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        {% for ti in ticketlist %}
            <tr align="center">
                <td>{{ ti.0 }}</td>
                <td>{{ ti.1 }}</td>
                <td>{{ ti.2|date:'Y-m-d'}}</td>
                <td>{{ ti.3 }}</td>
                <td>{{ ti.4 }}</td>
                <td>{{ ti.5 }}</td>
                <td>
                    {% if ti.6 == "1" %}
                        在售
                    {% endif %}
                    {% if ti.6 == "0" %}
                        停售
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
    </table>
</form>
</body>
</html>